home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / FileTransfers.a < prev    next >
Encoding:
Text File  |  1997-08-12  |  9.6 KB  |  383 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        FileTransfers.a
  3. ;
  4. ;    Contains:    CommToolbox File Transfer Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Release:    Universal Interfaces 3.0.1
  8. ;
  9. ;    Copyright:    © 1988-1997 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__FILETRANSFERS__') = 'UNDEFINED' THEN
  19. __FILETRANSFERS__ SET 1
  20.  
  21.     IF &TYPE('__CONDITIONALMACROS__') = 'UNDEFINED' THEN
  22.     include 'ConditionalMacros.a'
  23.     ENDIF
  24.     IF &TYPE('__STANDARDFILE__') = 'UNDEFINED' THEN
  25.     include 'StandardFile.a'
  26.     ENDIF
  27.     IF &TYPE('__CTBUTILITIES__') = 'UNDEFINED' THEN
  28.     include 'CTBUtilities.a'
  29.     ENDIF
  30.     IF &TYPE('__CONNECTIONS__') = 'UNDEFINED' THEN
  31.     include 'Connections.a'
  32.     ENDIF
  33.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  34.     include 'Files.a'
  35.     ENDIF
  36.     IF &TYPE('__TERMINALS__') = 'UNDEFINED' THEN
  37.     include 'Terminals.a'
  38.     ENDIF
  39.  
  40.  
  41. curFTVersion                    EQU        2                    ; current file transfer manager version
  42.  
  43.                                                             ; FTErr    
  44. ftGenericError                    EQU        -1
  45. ftNoErr                            EQU        0
  46. ftRejected                        EQU        1
  47. ftFailed                        EQU        2
  48. ftTimeOut                        EQU        3
  49. ftTooManyRetry                    EQU        4
  50. ftNotEnoughDSpace                EQU        5
  51. ftRemoteCancel                    EQU        6
  52. ftWrongFormat                    EQU        7
  53. ftNoTools                        EQU        8
  54. ftUserCancel                    EQU        9
  55. ftNotSupported                    EQU        10
  56. ; typedef OSErr                         FTErr
  57.  
  58.  
  59. ftIsFTMode                        EQU        $01
  60. ftNoMenus                        EQU        $02
  61. ftQuiet                            EQU        $04
  62. ftConfigChanged                    EQU        $10
  63. ftSucc                            EQU        $80
  64. ; typedef unsigned long                 FTFlags
  65.  
  66.  
  67. ftSameCircuit                    EQU        $01
  68. ftSendDisable                    EQU        $02
  69. ftReceiveDisable                EQU        $04
  70. ftTextOnly                        EQU        $08
  71. ftNoStdFile                        EQU        $10
  72. ftMultipleFileSend                EQU        $20
  73. ; typedef unsigned short                 FTAttributes
  74.  
  75.  
  76. ftReceiving                        EQU        0
  77. ftTransmitting                    EQU        1
  78. ftFullDuplex                    EQU        2                    ; (16) added ftFullDuplex bit.
  79. ; typedef unsigned short                 FTDirection
  80.  
  81. ;     application routines type definitions 
  82.  
  83.  
  84. ; typedef FTRecord *                    FTPtr
  85.  
  86. ; typedef FTPtr *                        FTHandle
  87.  
  88. FTRecord                RECORD 0
  89. procID                     ds.w    1                ; offset: $0 (0)
  90. flags                     ds.l    1                ; offset: $2 (2)
  91. errCode                     ds.w    1                ; offset: $6 (6)
  92. refCon                     ds.l    1                ; offset: $8 (8)
  93. userData                 ds.l    1                ; offset: $C (12)
  94. defProc                     ds.l    1                ; offset: $10 (16)
  95. config                     ds.l    1                ; offset: $14 (20)
  96. oldConfig                 ds.l    1                ; offset: $18 (24)
  97. environsProc             ds.l    1                ; offset: $1C (28)
  98. reserved1                 ds.l    1                ; offset: $20 (32)
  99. reserved2                 ds.l    1                ; offset: $24 (36)
  100. ftPrivate                 ds.l    1                ; offset: $28 (40)
  101. sendProc                 ds.l    1                ; offset: $2C (44)
  102. recvProc                 ds.l    1                ; offset: $30 (48)
  103. writeProc                 ds.l    1                ; offset: $34 (52)
  104. readProc                 ds.l    1                ; offset: $38 (56)
  105. owner                     ds.l    1                ; offset: $3C (60)
  106. direction                 ds.w    1                ; offset: $40 (64)
  107. theReply                 ds        SFReply            ; offset: $42 (66)
  108. writePtr                 ds.l    1                ; offset: $8C (140)
  109. readPtr                     ds.l    1                ; offset: $90 (144)
  110. theBuf                     ds.l    1                ; offset: $94 (148)
  111. bufSize                     ds.l    1                ; offset: $98 (152)
  112. autoRec                     ds        Str255            ; offset: $9C (156)
  113. attributes                 ds.w    1                ; offset: $19C (412)
  114. sizeof                     EQU *                    ; size:   $19E (414)
  115.                         ENDR
  116.  
  117.                                                             ; FTReadProc messages 
  118. ftReadOpenFile                    EQU        0                    ; count = forkFlags, buffer = pblock from PBGetFInfo 
  119. ftReadDataFork                    EQU        1
  120. ftReadRsrcFork                    EQU        2
  121. ftReadAbort                        EQU        3
  122. ftReadComplete                    EQU        4
  123. ftReadSetFPos                    EQU        6                    ; count = forkFlags, buffer = pBlock same as PBSetFPos 
  124. ftReadGetFPos                    EQU        7                    ; count = forkFlags, buffer = pBlock same as PBGetFPos 
  125.  
  126.                                                             ; FTWriteProc messages 
  127. ftWriteOpenFile                    EQU        0                    ; count = forkFlags, buffer = pblock from PBGetFInfo 
  128. ftWriteDataFork                    EQU        1
  129. ftWriteRsrcFork                    EQU        2
  130. ftWriteAbort                    EQU        3
  131. ftWriteComplete                    EQU        4
  132. ftWriteFileInfo                    EQU        5
  133. ftWriteSetFPos                    EQU        6                    ; count = forkFlags, buffer = pBlock same as PBSetFPos 
  134. ftWriteGetFPos                    EQU        7                    ; count = forkFlags, buffer = pBlock same as PBGetFPos 
  135.  
  136.                                                             ;    fork flags 
  137. ftOpenDataFork                    EQU        1
  138. ftOpenRsrcFork                    EQU        2
  139.  
  140. ;
  141. ; pascal FTErr InitFT(void )
  142. ;
  143.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  144.         IMPORT_CFM_FUNCTION InitFT
  145.     ENDIF
  146.  
  147. ;
  148. ; pascal Handle FTGetVersion(FTHandle hFT)
  149. ;
  150.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  151.         IMPORT_CFM_FUNCTION FTGetVersion
  152.     ENDIF
  153.  
  154. ;
  155. ; pascal short FTGetFTVersion(void )
  156. ;
  157.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  158.         IMPORT_CFM_FUNCTION FTGetFTVersion
  159.     ENDIF
  160.  
  161. ;
  162. ; pascal FTHandle FTNew(short procID, FTFlags flags, FileTransferSendUPP sendProc, FileTransferReceiveUPP recvProc, FileTransferReadUPP readProc, FileTransferWriteUPP writeProc, FileTransferEnvironsUPP environsProc, WindowPtr owner, long refCon, long userData)
  163. ;
  164.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  165.         IMPORT_CFM_FUNCTION FTNew
  166.     ENDIF
  167.  
  168. ;
  169. ; pascal void FTDispose(FTHandle hFT)
  170. ;
  171.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  172.         IMPORT_CFM_FUNCTION FTDispose
  173.     ENDIF
  174.  
  175. ;
  176. ; pascal FTErr FTStart(FTHandle hFT, FTDirection direction, const SFReply *fileInfo)
  177. ;
  178.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  179.         IMPORT_CFM_FUNCTION FTStart
  180.     ENDIF
  181.  
  182. ;
  183. ; pascal FTErr FTAbort(FTHandle hFT)
  184. ;
  185.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  186.         IMPORT_CFM_FUNCTION FTAbort
  187.     ENDIF
  188.  
  189. ;
  190. ; pascal FTErr FTSend(FTHandle hFT, short numFiles, FSSpecArrayPtr pFSSpec, FileTransferNotificationUPP notifyProc)
  191. ;
  192.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  193.         IMPORT_CFM_FUNCTION FTSend
  194.     ENDIF
  195.  
  196. ;
  197. ; pascal FTErr FTReceive(FTHandle hFT, FSSpecPtr pFSSpec, FileTransferNotificationUPP notifyProc)
  198. ;
  199.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  200.         IMPORT_CFM_FUNCTION FTReceive
  201.     ENDIF
  202.  
  203. ;
  204. ; pascal void FTExec(FTHandle hFT)
  205. ;
  206.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  207.         IMPORT_CFM_FUNCTION FTExec
  208.     ENDIF
  209.  
  210. ;
  211. ; pascal void FTActivate(FTHandle hFT, Boolean activate)
  212. ;
  213.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  214.         IMPORT_CFM_FUNCTION FTActivate
  215.     ENDIF
  216.  
  217. ;
  218. ; pascal void FTResume(FTHandle hFT, Boolean resume)
  219. ;
  220.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  221.         IMPORT_CFM_FUNCTION FTResume
  222.     ENDIF
  223.  
  224. ;
  225. ; pascal Boolean FTMenu(FTHandle hFT, short menuID, short item)
  226. ;
  227.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  228.         IMPORT_CFM_FUNCTION FTMenu
  229.     ENDIF
  230.  
  231. ;
  232. ; pascal short FTChoose(FTHandle *hFT, Point where, FileTransferChooseIdleUPP idleProc)
  233. ;
  234.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  235.         IMPORT_CFM_FUNCTION FTChoose
  236.     ENDIF
  237.  
  238. ;
  239. ; pascal void FTEvent(FTHandle hFT, const EventRecord *theEvent)
  240. ;
  241.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  242.         IMPORT_CFM_FUNCTION FTEvent
  243.     ENDIF
  244.  
  245. ;
  246. ; pascal Boolean FTValidate(FTHandle hFT)
  247. ;
  248.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  249.         IMPORT_CFM_FUNCTION FTValidate
  250.     ENDIF
  251.  
  252. ;
  253. ; pascal void FTDefault(Ptr *theConfig, short procID, Boolean allocate)
  254. ;
  255.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  256.         IMPORT_CFM_FUNCTION FTDefault
  257.     ENDIF
  258.  
  259. ;
  260. ; pascal Handle FTSetupPreflight(short procID, long *magicCookie)
  261. ;
  262.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  263.         IMPORT_CFM_FUNCTION FTSetupPreflight
  264.     ENDIF
  265.  
  266. ;
  267. ; pascal void FTSetupSetup(short procID, const void *theConfig, short count, DialogPtr theDialog, long *magicCookie)
  268. ;
  269.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  270.         IMPORT_CFM_FUNCTION FTSetupSetup
  271.     ENDIF
  272.  
  273. ;
  274. ; pascal Boolean FTSetupFilter(short procID, const void *theConfig, short count, DialogPtr theDialog, EventRecord *theEvent, short *theItem, long *magicCookie)
  275. ;
  276.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  277.         IMPORT_CFM_FUNCTION FTSetupFilter
  278.     ENDIF
  279.  
  280. ;
  281. ; pascal void FTSetupItem(short procID, const void *theConfig, short count, DialogPtr theDialog, short *theItem, long *magicCookie)
  282. ;
  283.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  284.         IMPORT_CFM_FUNCTION FTSetupItem
  285.     ENDIF
  286.  
  287. ;
  288. ; pascal void FTSetupXCleanup(short procID, const void *theConfig, short count, DialogPtr theDialog, Boolean OKed, long *magicCookie)
  289. ;
  290.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  291.         IMPORT_CFM_FUNCTION FTSetupXCleanup
  292.     ENDIF
  293.  
  294. ;
  295. ; pascal void FTSetupPostflight(short procID)
  296. ;
  297.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  298.         IMPORT_CFM_FUNCTION FTSetupPostflight
  299.     ENDIF
  300.  
  301. ;
  302. ; pascal Ptr FTGetConfig(FTHandle hFT)
  303. ;
  304.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  305.         IMPORT_CFM_FUNCTION FTGetConfig
  306.     ENDIF
  307.  
  308. ;
  309. ; pascal short FTSetConfig(FTHandle hFT, const void *thePtr)
  310. ;
  311.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  312.         IMPORT_CFM_FUNCTION FTSetConfig
  313.     ENDIF
  314.  
  315. ;
  316. ; pascal FTErr FTIntlToEnglish(FTHandle hFT, const void *inputPtr, Ptr *outputPtr, short language)
  317. ;
  318.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  319.         IMPORT_CFM_FUNCTION FTIntlToEnglish
  320.     ENDIF
  321.  
  322. ;  (16) chenged OSErr to FTErr
  323. ;
  324. ; pascal FTErr FTEnglishToIntl(FTHandle hFT, const void *inputPtr, Ptr *outputPtr, short language)
  325. ;
  326.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  327.         IMPORT_CFM_FUNCTION FTEnglishToIntl
  328.     ENDIF
  329.  
  330. ;  (16) chenged OSErr to FTErr
  331. ;
  332. ; pascal void FTGetToolName(short procID, Str255 name)
  333. ;
  334.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  335.         IMPORT_CFM_FUNCTION FTGetToolName
  336.     ENDIF
  337.  
  338. ;
  339. ; pascal short FTGetProcID(ConstStr255Param name)
  340. ;
  341.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  342.         IMPORT_CFM_FUNCTION FTGetProcID
  343.     ENDIF
  344.  
  345. ;
  346. ; pascal void FTSetRefCon(FTHandle hFT, long refCon)
  347. ;
  348.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  349.         IMPORT_CFM_FUNCTION FTSetRefCon
  350.     ENDIF
  351.  
  352. ;
  353. ; pascal long FTGetRefCon(FTHandle hFT)
  354. ;
  355.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  356.         IMPORT_CFM_FUNCTION FTGetRefCon
  357.     ENDIF
  358.  
  359. ;
  360. ; pascal void FTSetUserData(FTHandle hFT, long userData)
  361. ;
  362.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  363.         IMPORT_CFM_FUNCTION FTSetUserData
  364.     ENDIF
  365.  
  366. ;
  367. ; pascal long FTGetUserData(FTHandle hFT)
  368. ;
  369.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  370.         IMPORT_CFM_FUNCTION FTGetUserData
  371.     ENDIF
  372.  
  373. ;
  374. ; pascal void FTGetErrorString(FTHandle hFT, short id, Str255 errMsg)
  375. ;
  376.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  377.         IMPORT_CFM_FUNCTION FTGetErrorString
  378.     ENDIF
  379.  
  380.  
  381.     ENDIF ; __FILETRANSFERS__ 
  382.  
  383.